package com.topscomm.mms.script;

import com.topscomm.cbo.pojo.CboApprovalNodeInsEntity;
import com.topscomm.mms.service.impl.MmsResponseService;
import com.topscomm.pub.util.ConvertUtil;
import com.topscomm.pub.util.SpringUtil;
import com.topscomm.tap.ITapService;
import com.topscomm.tap.TapEntity;
import com.topscomm.tap.TapScript;
import org.springframework.transaction.annotation.Transactional;


public class MmsResponsetScript extends TapScript {

    /**
     * @Title:
     * @description:
     * @param service
     * @param entity
     * @throws Exception
     * @author:
     * @date:
     * @modify:
    */
    @Transactional
    public void insertResponse(ITapService service, TapEntity entity) throws Exception {
        // 审批节点实例
        CboApprovalNodeInsEntity nodeins = (CboApprovalNodeInsEntity) entity;
        if (nodeins.getApprovalopinion().equals("")) {
            return;
        }
        MmsResponseService mmsResponseService = (MmsResponseService) SpringUtil.getBean("mmsResponseService");
        mmsResponseService.insertApprovalIntoResponse(nodeins);
    }
    /**
     * @Title:
     * @description:
     * @param service
     * @param entity
     * @throws Exception
     * @author:
     * @date:
     * @modify:
    */
//    @Transactional
//    public void updateResponse(ITapService service, TapEntity entity) throws Exception {
//        // 审批节点实例
//        CboApprovalNodeInsEntity nodeins = (CboApprovalNodeInsEntity) entity;
//        MmsResponseService mmsResponseService = (MmsResponseService) SpringUtil.getBean("mmsResponseService");
//        mmsResponseService.updateSubmitApprovalOpinion(nodeins);
//    }
}
